Skip to content

Show mount progress phases in CLI during gvfs mount#2005

Open
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/mount-progress
Open

Show mount progress phases in CLI during gvfs mount#2005
tyrielv wants to merge 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/mount-progress

Conversation

@tyrielv
Copy link
Copy Markdown
Contributor

@tyrielv tyrielv commented Jun 4, 2026

Summary

Show detailed mount progress in the CLI during gvfs mount. Previously users saw a single "Mounting..." spinner with no detail. Now the spinner updates with the current phase:

Mounting (Authenticating and validating)...
Mounting (Resolving cache server)...
Mounting (Starting virtualization)...
Mounting...Succeeded

Problem

After parallelizing pre-mount operations in InProcessMount (#1908), the named pipe server started late (after all validations complete), so MountVerb had less time to poll status. Even after pipe connect, GetStatus only returned "Mounting" with no sub-phase detail.

Changes

Protocol - Add MountProgress string to GetStatus.Response (backward compatible)

InProcessMount (GVFS.Mount)

  • Move pipe server start to after RepoMetadata init, before parallel tasks - MountVerb can connect ~2-3s earlier
  • Set progress messages at each phase transition ("Authenticating and validating", "Resolving cache server", "Preparing mount", "Starting virtualization")
  • Guard non-GetStatus pipe handlers during Mounting state (prevents crashes from early requests to uninitialized subsystems)
  • Make currentState volatile for correct cross-thread reads
  • Null-safe field access in HandleGetStatusRequest for early-pipe window

ConsoleHelper (GVFS.Common)

  • New ShowStatusWhileRunning overloads accepting Func<string> getMessage for dynamic spinner text with line-clearing

GVFSEnlistment (GVFS.Common)

  • Optional Action<string> onProgress callback on WaitUntilMounted (default null, existing callers unaffected)

MountVerb (GVFS)

  • Wire dynamic spinner to progress callback from WaitUntilMounted

Parallelism handling

The parallel phase (network auth + local validation) uses a single combined progress message set before Task.Run, updated only after Task.WaitAll. No per-task racing.

Testing

  • 818 unit tests pass
  • Build verified for GVFS, GVFS.Mount, GVFS.UnitTests

@tyrielv tyrielv force-pushed the tyrielv/mount-progress branch from febec85 to 7669cb3 Compare June 4, 2026 20:12
@tyrielv tyrielv marked this pull request as ready for review June 4, 2026 20:23
Move the named pipe server start earlier in InProcessMount so
MountVerb can connect and poll status during the parallel
auth+validation phase. Add a MountProgress field to the GetStatus
response carrying a human-readable phase description that the CLI
renders as a dynamic spinner sub-status.

Changes:
- NamedPipeMessages: add MountProgress to GetStatus.Response
- InProcessMount: volatile progress string set at each phase;
  pipe started after RepoMetadata init (before parallel tasks);
  HandleRequest guards non-GetStatus during Mounting state;
  HandleGetStatusRequest null-safe for early-pipe fields
- ConsoleHelper: new ShowStatusWhileRunning overloads accepting
  Func<string> getMessage for dynamic spinner text
- GVFSEnlistment: optional Action<string> onProgress callback on
  WaitUntilMounted (existing callers unaffected)
- MountVerb: wires dynamic spinner to progress callback

User sees: Mounting (Authenticating and validating)...
           Mounting (Starting virtualization)...
           Mounting...Succeeded

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
@tyrielv tyrielv force-pushed the tyrielv/mount-progress branch from 7669cb3 to 6af85b2 Compare June 5, 2026 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant